<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js变量</title>
    <script>
        //变量的声明
        var x = 100;
        //弹窗  在测试阶段用的比较多 开发中少用
        //alert(x);
        //输入弹窗
        var  y = prompt();
        console.log(y);
        //控制台输出  log日志输出  error输出
        //console.log(x);
        //console.error(x);
        //先声明在赋值
        var name;
        name="joke";
        console.error(name);

        //赋值和声明多个变量
        //先声明多个变量在给多个变量赋值
        var age,address,sex;
        age = 20;
        address = "西安市";
        sex = "男";

        console.log(age);
        console.log(address);
        console.log(sex);
        //声明和赋值多个变量
        var weight = 45.0,height = 185;
        console.log(weight);
        console.log(height);

        var  num ;
        //undefined  未定义
        console.log(num)
    </script>
</head>
<body>

</body>
</html>